<?php

	// This page will list all of the items
	// from the items table. Each item will have
	// a link to add it to the cart

	require_once("../global.php");
	require_once("../uis.php");
	require_once("../config.php");
	require_once("../functions.php");
	include("local.php");
	require_once("pcrypt.php");

	$sql="SELECT * FROM ".$config->dt['files']." WHERE permissions='paid' AND purchase='on' ORDER BY name asc";
	$result = mysql_query($sql);
	?>
		<html>
		<head>
		<title> Product List </title>
		</head>
		<body bgcolor="#ffffff">
		<h1>Products</h1>
		<table width="100%" cellspacing="0" cellpadding="0" border="0">
			<tr>
				<td width="30%" bgcolor="#CCCCCC">
					<font face="verdana" size="1" color="white">
						&nbsp;&nbsp;<b>Product</b>
					</font>
				</td>
				<td width="10%" bgcolor="#CCCCCC">
					<font face="verdana" size="1" color="white">
						<b>Price</b>
					</font>
				</td>
				<td width="50%" bgcolor="#CCCCCC">
					<font face="verdana" size="1" color="white">
						<b>Description</b>
					</font>
				</td>
				<td width="10%" bgcolor="#CCCCCC">
					<font face="verdana" size="1" color="white">
						<b>Add</b>
					</font>
				</td>
			</tr>
			<?php
			while($row = mysql_fetch_array($result))
			{
			?>
				<tr>
					<td width="30%" height="25">
						<font face="verdana" size="1" color="black">
							<?php echo $row["name"]; ?>
						</font>
					</td>
					<td width="10%" height="25">
						<font face="verdana" size="1" color="black">
							$<?php echo $row["cost"]; ?>
						</font>
					</td>
					<td width="50%" height="25">
						<font face="verdana" size="1" color="black">
							<?php echo $row["description"]; ?>
						</font>
					</td>
					<td width="10%" height="25">
						<font face="verdana" size="1" color="black">
							<a href="cart.php?action=add_item&id=<?php echo $row["id"]; ?>&c=<?php print urlencode(encrypt($row["id"]."AAA111AAA".$row["cost"])); ?>&qty=1&p=<?php echo $row["cost"]; ?>&k=<?php print urlencode(encrypt($row['cost'])); ?>">Add Item</a>
						</font>
					</td>
				</tr>
				<tr>
					<td width="100%" colspan="4">
						<hr size="1" color="black" NOSHADE>
					</td>
				</tr>
			<?php
			}
		?>
			<tr>
				<td width="100%" colspan="4">
					<font face="verdana" size="1" color="black">
						<a href="cart.php">Your Shopping Cart &gt;&gt;</a>
					</font>
				</td>
			</tr>
		</table>
	</body>
</html>